TUI: fix request_user_input wrapping for long option labels#11123
TUI: fix request_user_input wrapping for long option labels#11123charley-oai merged 14 commits intomainfrom
Conversation
|
@codex review this |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f58e3bbf28
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review this |
|
Codex Review: Didn't find any major issues. Delightful! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review this |
|
Codex Review: Didn't find any major issues. Delightful! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
aibrahim-oai
left a comment
There was a problem hiding this comment.
nit: let's order functions by visibility and importance. Important functions should be up
|
@codex review this |
|
Codex Review: Didn't find any major issues. Keep it up! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
This PR fixes long-text rendering in the
request_user_inputTUI overlay while preserving a clear two-column option layout. (Issue #11093)Before:
After:
Problem
request_user_inputneeds to handle verbose prompts/options. With oversized labels:Root Cause
In shared row rendering (
selection_popup_common):desc_coltoo far right for long labelsrequest_user_inputrows did not provide wrap metadata to align continuation lines after the option prefixWhat Changed
1)
request_user_inputrows opt into wrapped labelsFile:
codex-rs/tui/src/bottom_pane/request_user_input/mod.rsoption_rows(), compute the rendered option prefix (› 1./2.) and setwrap_indentfrom its display width.question_with_very_long_option_text+request_user_input_long_option_text_snapshot).2) Shared renderer now has an opt-in two-column wrapping path
File:
codex-rs/tui/src/bottom_pane/selection_popup_common.rsshould_wrap_name_in_columnwrap_two_column_rowwrap_standard_rowwrap_row_linesapply_row_state_stylewrap_indent+ description), wrap label and description independently in their own columns.wrap_row_linesfunction in both rendering and height measurement to keep them in sync.3) Keep column sizing simple and derived from existing fixed split constants
File:
codex-rs/tui/src/bottom_pane/selection_popup_common.rs3/10left column (30/70split).constants/branches.
wrap_two_column_rowso extremely small widths do not panic.4) Snapshot coverage
File:
codex-rs/tui/src/bottom_pane/request_user_input/snapshots/ codex_tui__bottom_pane__request_user_input__tests__request_user_input_long_option_text.snap